function Program() {
  this.name = "Program"
  this.description = ""
  this.author = ""
  this.version = "0"

  this.levels = []
  this.actualLevel = null

  this.assets = []
}

Program.prototype.addLevel = addLevel
Program.prototype.removeLevel = removeLevel
Program.prototype.addDefaultLevel = addDefaultLevel

function addDefaultLevel() {
  var level = new Level()
  level.add(new THREE.AmbientLight(0x202020))

  var light = new PointLight(0x909090)
  light.position.set(0, 5, -5)
  level.add(light)

  this.addLevel(level)

  if (this.actualLevel === null) {
    this.actualLevel = this.levels[0]
  }

  return level
}

function removeLevel(level) {
  var index = this.levels.indexOf(level)
  if (index > -1) {
    this.levels.splice(index, 1)
  }

  if (this.levels.length === 0) {
    this.actualLevel = null
  }
}

function addLevel(level) {
  this.levels.push(level)
}
